The gxComponentMode type is used for transfer component mode constants.
typedef unsigned char gxComponentMode;
A transfer component mode constants specifies the type of transfer mode (like "copy" or "XOR") to use. For more information about the transfer modes for QuickTime vectors, see "Transfer Modes" .
The following transfer mode constants are defined:
No mode. No transfer occurs. For this component of the color, the destination is left as it was. This mode is useful for suppressing drawing when certain logical conditions are met, or for not drawing one color component while allowing other components to be drawn. |
||
Copy mode. The source color component is copied to the destination. The destination component is ignored. This is the most common transfer mode, and is the default for QuickDraw GX. |
||
Add mode. The source color component is added to the destination component, but the result is not allowed to exceed the maximum value ( 0xFFFF or gxColorValue1 ; white in Figure 39 ). |
||
Blend mode. The result is the average of the source and destination color components, weighted by a ratio specified by the operand component (0.5 in Figure 39 ). The operand varies from 0 (all destination) to 0xFFFF or gxColorValue1 (all source), although it is customary to interpret it as varying between 0 and 1 . |
||
Migrate mode. The destination color component is moved toward the source component by the value of the step specified in the operand component (0.25, or 0x4000 in Figure 39 ). Migrate mode is similar to blend mode, except that the change in destination component is an absolute amount, rather than a proportion of the difference between it and the source component. If the source has a greater color component value than the destination, the migration is positive; if the destination has a greater value than the source, the migration is negative. In either case, the amount of migration cannot be greater than the difference between the destination and the source values. |
||
Minimum mode. The source component replaces the destination component only if the source component has a smaller value. (In Figure 39 , drawing occurs only within the area occupied by the cloud.) |
||
Maximum mode. The source component replaces the destination component only if the source component has a larger value. (In Figure 39 , drawing occurs only outside of the area occupied by the cloud.) |
||
Highlight mode. The source component and operand component are swapped in the destination. Other components in the destination are ignored. |
||
AND mode. The bits of the source color and destination color are combined using an AND operation. Only bits that are set in both source and destination remain set in the result. |
||
OR mode. The bits of the source color and destination color are combined using an OR operation. Bits that are set in either the source or the destination or in both are set in the result. |
||
XOR mode. The bits of the source color and destination color are combined using an exclusive-OR (XOR) operation. Bits that are set in the source but not the destination, and bits that are set in the destination but not the source, are set in the result. All other bits are cleared in the result. |
||
Ramp-AND mode. The source and destination color components are treated as ranging from 0 to 1; their product (source ¥ destination) is returned. |
||
Ramp-OR mode. The source and destination color components are treated as ranging from 0 to 1; the result of (source + destination - source ¥ destination) is returned. |
||
Ramp-XOR mode. The source and destination color components are treated as ranging from 0 to 1; the result of (source + destination - 2 ¥ source ¥ destination) is returned. |
||
Over mode. The source color is copied to the destination, and the source transparency controls where the destination color shows through. Where both are transparent, no drawing occurs (result equals destination). |
||
Atop mode. The source color is placed over the destination, but the resulting destination retains the original destination's transparency. The effect is that opaque parts of the source are clipped to cover only opaque parts of the destination. |
||
Exclude mode. The destination color remains visible only where the source is transparent, and the source color is copied anywhere the destination is transparent. Where both are transparent, no drawing occurs (result equals destination); where both are opaque, the result color is 0 (no intensity). |
||
Fade mode. The source is blended with the destination, using the relative alpha values as the ratio for the blend. Where both are transparent, the result is the average of the source and the destination). |
| Previous | Chapter Contents | Chapter Top | Next |